home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / windows / fc_11f.zip / WWWFC4.MN$ < prev    next >
Text File  |  1992-07-15  |  4KB  |  113 lines

  1. ; This menu file contains a few "more advanced" menu items for
  2. ; more experienced users.
  3.  
  4. ; The AutoExec Section on top here.
  5. ; Make sure widely used constants are defined!
  6.  
  7.         TAB=num2char(9)
  8.         CR=strcat(num2char(13),num2char(10))
  9.  
  10.  
  11. Interactive File Commander
  12.           if !IsDefined(uyit65) then uyit65=`Message("2+2 is",2+2)`
  13.           :NEXT
  14.           uyit65=AskLine("Interactive Execution","Enter Command",uyit65)
  15.           execute %uyit65%
  16.           goto NEXT
  17.  
  18.  
  19. Excel DDE Example
  20. ;This code makes a multiplication table in Excel via DDE
  21.                                                          ; Find Excel
  22.          a=FileLocate("excel.exe")                       ; Try brute force path search
  23.          if a=="" then a=IniRead("extensions","xls","")  ; No? Try via [extensions] section
  24.          terminate(a=="","Error","Excel not found")      ; Not installed normally
  25.          b=strindex(a," ",0,@FWDSCAN)                    ; Find first space
  26.          if b==0 then b=strlen(a)+1                      ; None? ...adjust b
  27.          b=strsub(a,1,b-1)                               ; Pick off ^.xls stuff
  28.          run(b,"")                                       ; Run Excel
  29.  
  30.          channel = DDEInitiate("Excel", "Sheet1")
  31.  
  32.          Numbers="One Two Three Four Five Six Seven Eight Nine Ten"
  33.  
  34.          offset=1
  35.          row=0
  36.  
  37.          :rowloop
  38.          col=0
  39.          row=row+1
  40.          if row > 10 then goto byebye
  41.  
  42.          ThisNum=ItemExtract(row,Numbers," ")
  43.          title=row+offset
  44.          DDEPoke(channel, "R1C%title%", ThisNum)
  45.          DDEPoke(channel, "R%title%C1", ThisNUm)
  46.  
  47.          :colloop
  48.          col=col+1
  49.          if col > 10 then goto rowloop
  50.  
  51.          expression="=%row%*%col%"
  52.          address=strcat("R",row+offset,"C",col+offset)
  53.          DDEPoke(channel,address,expression)
  54.          goto colloop
  55.  
  56.          :byebye
  57.          DDETerminate(channel)
  58.  
  59.  
  60. Days between today and ???
  61.         ;First convert todays date to Julian Equivalent
  62.          
  63.         ; extracts separate M, D, and Y variables from DateTime string
  64.         ; assumes international date format is standard U.S. (MM/DD/YY)
  65.  
  66.         dt = strtrim(DateTime())
  67.         dt = ItemExtract(3,dt," ")
  68.         dm = ItemExtract(1,dt,"/")
  69.         dd = ItemExtract(2,dt,"/")
  70.         dy = ItemExtract(3,dt,"/")
  71.  
  72.         ; performs the actual conversion
  73.         dm = dm + 9
  74.         dy = dy + dm / 12 + 399
  75.         dm = dm mod 12
  76.         today = dy * 365 + dy / 4 - dy / 100 + dy / 400 + (153 * dm + 2) / 5 + dd - 146037
  77.         xt=strtrim(AskLine("Day Counter","Enter target date",dt))
  78.  
  79.         xm = ItemExtract(1,xt,"/")
  80.         xd = ItemExtract(2,xt,"/")
  81.         xy = ItemExtract(3,xt,"/")
  82.  
  83.         ; performs the actual conversion
  84.         xm = xm + 9
  85.         xy = xy + xm / 12 + 399
  86.         xm = xm mod 12
  87.         other = xy * 365 + xy / 4 - xy / 100 + xy / 400 + (153 * xm + 2) / 5 + xd - 146037
  88.         diff=abs(today-other);
  89.         Message("Day Counter","%dt% <=> %xt%%CR%Are %diff% days apart")
  90.         drop(dt,dm,dd,dy,xm,xd,xy,xt,today,other,diff)
  91.  
  92. Command Line Calculator
  93.          a=AskLine("Calculator","Enter numbers","2+2")
  94.          if a=="" then exit
  95.          Run("calc.exe","")
  96.          ClipPut(a)
  97.          Sendkey("+{INSERT}")
  98.          SendKey("{ENTER}")
  99.          SendKey("^{INSERT}")
  100.          WinClose("Calc")
  101.          b=ClipGet()
  102.          Message("Calc","%a% is%CR%%b%")
  103.  
  104. _Arrange Windows
  105.  &1 Cascade
  106.         winarrange(1)
  107.  &2 Tile
  108.         winarrange(2)
  109.  &3 Tile in Rows (4 max)
  110.         winarrange(3)
  111.  &4 Tile in Columns (3 max)
  112.         winarrange(4)
  113.